<template>
  <div id="warehouseReceipt">
    <el-row
      type="flex"
      justify="space-between"
      align="center"
      :gutter="20"
      style="width: 100%; margin-bottom: 10px"
    >
      <el-col :span="10" style="display: flex"
        ><span style="width: 60px; height: 40px; line-height: 40px">搜索：</span
        ><el-input placeholder="材料类型/材料名称" v-model="projectInput"></el-input
      ></el-col>

      <el-col :span="8" style="display: flex">
        <el-date-picker
          style="width: 100%"
          v-model="from.date"
          type="daterange"
          format="yyyy-MM-dd"
          range-separator="至"
          start-placeholder="选择开始日期"
          end-placeholder="选择结束日期"
        >
        </el-date-picker
      ></el-col>
      <el-col :span="8" style="display: flex">
        <el-select style="width: 150%" v-model="from.bdmc" placeholder="标段名称">
          <el-option label="审核中" value="审核中"> </el-option>
          <el-option label="已通过" value="已通过"> </el-option>
          <el-option label="未通过" value="未通过"> </el-option> </el-select
      ></el-col>
      <el-col :span="7" style="display: flex"
        ><el-button type="primary" @click="searchHandler">查询</el-button
        ><el-button plain @click="resetHandler">重置</el-button></el-col
      >
      <el-col :span="7" style="display: flex"></el-col>
    </el-row>
    <el-row
      type="flex"
      justify="center"
      align="center"
      style="width: 100%; margin-bottom: 10px"
    >
      <el-button type="primary" @click="addHandler">新增</el-button>
      <el-button type="warning" @click="audit">审核</el-button>
      <el-button type="warning">批量导出</el-button>
      <el-button type="primary" @click="shuaxin">刷新</el-button>
      <el-col :span="20" style="display: flex"></el-col>
      <el-col :span="2" :pull="1" style="display: flex"></el-col>
    </el-row>
    <el-row>
      <el-table
        :data="renderData"
        border
        style="width: 100%"
        :header-cell-style="{ background: '#606266', color: '#fff' }"
        height="800"
        @selection-change="handleSelectionChange"
      >
        <el-table-column type="selection" width="55"> </el-table-column>
        <el-table-column fixed type="index" label="序号" width="50" align="center" />
        <el-table-column fixed prop="bh" label="编号" align="center" width="150">
        </el-table-column>
        <el-table-column prop="fqsj" label="发起时间" align="center" width="200">
        </el-table-column>
        <el-table-column prop="djzt" label="单据状态" align="center" width="150">
        </el-table-column>
        <el-table-column prop="cllx" label="材料类型" align="center" width="200">
        </el-table-column>
        <el-table-column prop="pplx" label="品牌类型" align="center" width="200">
        </el-table-column>
        <el-table-column prop="clbm" label="材料编码" align="center" width="200">
        </el-table-column>
        <el-table-column prop="clmc" label="材料名称" align="center" width="200">
        </el-table-column>
        <el-table-column prop="gysmc" label="供应商名称" align="center" width="200">
        </el-table-column>
        <el-table-column prop="gg" label="规格" align="center" width="100">
        </el-table-column>
        <el-table-column prop="dw" label="单位" align="center" width="100">
        </el-table-column>
        <el-table-column prop="hgzt" label="合格状态" align="center" width="100">
        </el-table-column>
        <el-table-column prop="fzr" label="负责人" align="center" width="100">
        </el-table-column>
        <el-table-column prop="csr" label="抄送人" align="center" width="100">
        </el-table-column>
        <el-table-column prop="xgwj" label="相关文件" align="center" width="100">
        </el-table-column>
        <el-table-column label="操作" width="180" align="center" fixed="right">
          <template slot-scope="scope">
            <el-button
              style="color: rgb(250, 55, 55)"
              type="text"
              @click="editHandler(scope.row)"
              >编辑</el-button
            >
            <el-button type="text" @click="editHandler(scope.row)">查看</el-button>
            <el-button type="text" style="color: red" @click="deleteHandler(scope.row.id)"
              >删除</el-button
            >
          </template>
        </el-table-column>
      </el-table>
    </el-row>
    <el-row style="position: absolute; right: 50px">
      <el-pagination
        background
        @size-change="handleSizeChange"
        @current-change="handleCurrentChange"
        :current-page="currentPage"
        :page-sizes="[10, 20, 50]"
        :page-size="10"
        layout="total, sizes, prev, pager, next, jumper"
        :total="total"
      ></el-pagination>
    </el-row>
    <!-- 处理 -->
    <el-dialog
      :close-on-click-modal="false"
      :close-on-press-escape="false"
      :title="editTiele"
      :visible.sync="editDialogStatus"
      width="60%"
      :modal="false"
      class="addsiloScan"
    >
      <el-form
        :model="from"
        ref="from"
        label-width="150px"
        class="warehouseBill-ruleForm"
      >
        <el-row class="mgb-10 from">
          <el-col :span="8" style="display: flex">
            <el-form-item label="单号:" prop="bdmc">
              <el-input
                style="width: 110%"
                placeholder="RK20230619-001"
                disabled
                v-model="from.pbbm"
              >
              </el-input>
            </el-form-item>
          </el-col>
          <!-- <el-col :span="8" style="display: flex">
            <el-form-item label="标段名称:" prop="bdmc">
              <el-input
                style="width: 110%"
                placeholder="成都13号线1工区"
                disabled
                v-model="from.pbbm"
              >
              </el-input>
            </el-form-item>
          </el-col> -->
          <el-col :span="8" style="display: flex">
            <el-form-item label="制单人:" prop="bdmc">
              <el-input
                style="width: 110%"
                placeholder="管理员1"
                disabled
                v-model="from.pbbm"
              >
              </el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row class="mgb-10 from">
          <el-col :span="8" style="display: flex">
            <el-form-item label="材料类型:" prop="cklx">
              <el-select style="width: 102%" v-model="from.cllx" placeholder="材料类型">
                <el-option label="粉料" value="粉料"> </el-option>
                <el-option label="钢筋" value="钢筋"> </el-option>
                <el-option label="骨科" value="骨科"> </el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="8" style="display: flex">
            <el-form-item label="品牌类型:" prop="cklx">
              <el-select style="width: 102%" v-model="from.pplx" placeholder="品牌类型">
                <el-option label="中国制造" value="中国制造"> </el-option>
                <el-option label="进口产品" value="进口产品"> </el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="8" style="display: flex">
            <el-form-item label="材料名称:" prop="cklx">
              <el-select style="width: 102%" v-model="from.clmc" placeholder="品牌类型">
                <el-option label="钢筋" value="钢筋"> </el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row class="mgb-10 from">
          <el-col :span="8" style="display: flex">
            <el-form-item label="供应商:" prop="cklx">
              <el-select style="width: 102%" v-model="from.gysmc" placeholder="供应商">
                <el-option label="四川欣顺建材有限公司" value="四川欣顺建材有限公司">
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="8" style="display: flex">
            <el-form-item label="抄送人:" prop="cklx">
              <el-select style="width: 102%" v-model="from.csr" placeholder="抄送人">
                <el-option label="张三" value="张三"> </el-option>
                <el-option label="李四" value="李四"> </el-option>
                <el-option label="王五" value="王五"> </el-option>
                <el-option label="赵六" value="赵六"> </el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="8" style="display: flex">
            <el-form-item label="负责人:" prop="wgid">
              <el-select style="width: 102%" v-model="from.fzr" placeholder="负责人">
                <el-option label="张三" value="张三"> </el-option>
                <el-option label="李四" value="李四"> </el-option>
                <el-option label="王五" value="王五"> </el-option>
                <el-option label="赵六" value="赵六"> </el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-form-item label="相关文件:" prop="bdmc">
          <el-upload
            style="color: rgb(199, 199, 199)"
            class="upload-demo"
            ref="upload"
            :action="uploadUrl"
            :on-preview="handlePreview"
            :on-remove="handleRemove"
            :before-remove="beforeRemove"
            multiple
            :auto-upload="false"
            :on-change="handleChange"
          >
            <el-button size="small" type="text" style="font-size: 16px; color: #5677fc"
              ><i class="el-icon-upload"></i>点击上传</el-button
            >
            <div slot="tip" class="el-upload__tip">
              上传文件格式仅支持xls,xksx,且文件大小不得超过5MB
            </div>
          </el-upload>
        </el-form-item>
      </el-form>

      <span slot="footer" class="dialog-footer">
        <el-button @click="editDialogStatus = false">取 消</el-button>
        <el-button type="primary" @click="addProjectApi()">确 定</el-button>
      </span>
      <!-- <el-dialog
        :close-on-click-modal="false"
        :title="editTiele"
        :visible.sync="addDialogStatus"
        width="60%"
        :append-to-body="true"
      >
        <div style="position: relative">
          <el-form :model="from" ref="from" label-width="100px" class="demo-ruleForm">
            <el-row class="mgb-10 from">
              <el-col :span="12" style="display: flex">
                <el-form-item label="搜索:" prop="pbbm">
                  <el-input
                    style="width: 150%"
                    placeholder="品牌名称/规格型号/材料类型"
                    v-model="serchFrom.sousuo"
                  >
                  </el-input>
                </el-form-item>
              </el-col>
            </el-row>
          </el-form>

          <el-table
            :data="renderDataThree"
            border
            style="width: 100%; margin-bottom: 20px"
            :header-cell-style="{ background: '#606266', color: '#fff' }"
            height="380"
          >
            <el-table-column type="selection" width="55"> </el-table-column>
            <el-table-column type="index" label="序号" width="100" align="center" />
            <el-table-column prop="cllx" label="材料类型" align="center" width="100">
            </el-table-column>
            <el-table-column prop="ppmc" label="品牌名称" align="center" width="150">
            </el-table-column>
            <el-table-column prop="clbm" label="材料编码" align="center">
            </el-table-column>
            <el-table-column prop="ggxh" label="规格型号" align="center">
            </el-table-column>
            <el-table-column prop="dw" label="单位" align="center"> </el-table-column>
            <el-table-column prop="dj" label="库存" align="center"> </el-table-column>

            <el-table-column prop="bz" label="备注" align="center"> </el-table-column>
          </el-table>
          <el-pagination
            background
            @size-change="handleSizeChange"
            @current-change="handleCurrentChange"
            :current-page="currentPage"
            :page-sizes="[10, 20, 50]"
            :page-size="10"
            layout="total, sizes, prev, pager, next, jumper"
            :total="total"
            style="position: absolute; bottom: -45px"
          ></el-pagination>
        </div>
        <span slot="footer" class="dialog-footer">
          <el-button @click="addDialogStatus = false">取 消</el-button>
          <el-button type="primary" @click="addDialogStatus = false">确 定</el-button>
        </span>
      </el-dialog> -->
    </el-dialog>
    <el-dialog
      :close-on-click-modal="false"
      :close-on-press-escape="false"
      title="审核"
      :visible.sync="auditDialogStatus"
      width="40%"
      :modal="false"
    >
      <el-form
        :model="auditform"
        ref="auditform"
        label-width="100px"
        class="demo-auditform"
      >
        <el-form-item label="审批结果" prop="approveOperation">
          <el-radio-group v-model="auditform.approveOperation">
            <el-radio label="1">通过</el-radio>
            <el-radio label="0">不通过</el-radio>
          </el-radio-group>
        </el-form-item>

        <el-form-item label="批复意见">
          <el-input
            type="textarea"
            resize="none"
            v-model="auditform.comment"
            style="width: 90%"
          ></el-input>
        </el-form-item>
        <el-form-item
          v-if="auditform.approveOperation == 0"
          label="是否复检"
          prop="approveOperation2"
        >
          <el-radio-group v-model="auditform.approveOperation2">
            <el-radio label="1">是</el-radio>
            <el-radio label="0">否</el-radio>
          </el-radio-group>
        </el-form-item>
        <el-form-item v-if="auditform.approveOperation == 0" label="负责人" prop="fzr">
          <el-select style="width: 90%" v-model="from.fzr" placeholder="标段名称">
            <el-option label="张三" value="张三"> </el-option>
            <el-option label="李四" value="李四"> </el-option>
            <el-option label="王五" value="王五"> </el-option>
          </el-select>
        </el-form-item>
        <el-form-item v-if="auditform.approveOperation == 0" label="抄送人" prop="csr">
          <el-select style="width: 90%" v-model="from.csr" placeholder="标段名称">
            <el-option label="张三" value="张三"> </el-option>
            <el-option label="李四" value="李四"> </el-option>
            <el-option label="王五" value="王五"> </el-option>
          </el-select>
        </el-form-item>
      </el-form>
      <div style="display: flex">
        <h3
          style="margin-left: 2.3rem; width: 7.5%; margin-right: 10px"
          class="overviewContentTitle"
        >
          审批流
        </h3>
        <div class="overviewContentLeftbottom">
          <img class="shenpiPng" src="../../../../static/img/shenpi.png" alt="" />
          <div class="steps">
            <div class="stepsItem" v-for="(item, index) in steps" :key="index">
              <div class="userImg">
                <img v-if="index == 0" src="../warehouseReceipt/img/img.jpg" alt="" />
                <img
                  v-else-if="index == 1"
                  src="../warehouseReceipt/img/img3.jpg"
                  alt=""
                />
                <img v-else src="../warehouseReceipt/img/img2.jpg" alt="" />
              </div>
              <div style="width: 100%; color: black" class="">
                <div class="xmtime">
                  <div>
                    {{ item.assignee
                    }}<span style="color: #409eff; margin-left: 10px">
                      {{ item.name }}</span
                    >
                  </div>
                  <div>
                    {{ item.startTime }}
                  </div>
                </div>
                <div class="nr">
                  {{ item.comment }}
                </div>
              </div>
              <div class="progress" v-if="index < steps.length - 1"></div>
            </div>
          </div>
        </div>
      </div>

      <span slot="footer" class="dialog-footer">
        <el-button @click="auditDialogStatus = false">取 消</el-button>
        <el-button type="primary" @click="shenheProjectApi()">确 定</el-button>
      </span>
    </el-dialog>
  </div>
</template>

<script>
// import {
//   getProjectList,
//   projectDetail,
//   addProject,
//   updateProject,
//   deleteProject,
// } from "../../../http/projectMg.js";
export default {
  data() {
    return {
      dialogVisible: false,
      projectInput: "",
      renderData: [],
      renderDataThree: [],
      total: 0,
      pageSize: 10,
      currentPage: 1,
      isSearch: false,
      // edit
      editTiele: "",
      editDialogStatus: false,
      addDialogStatus: false,
      auditDialogStatus: false,
      editProjectIdentifyInput: "",
      editProjectInput: "",
      from: {},
      auditform: { approveOperation: "1" },
      serchFrom: { sousou: "" },
      multipleSelection: [],
      steps: [
        {
          id: "d2bc97a4-7930-11ee-842f-005056c00001",
          name: "发起审批 ",
          taskDefinitionKey: "firstLevelApproval",
          assignee: "admin",
          comment: "审批意见",
          startTime: "2023-11-02 11:35:09",
          endTime: "2023-11-02 15:50:33",
          deleteReason: null,
          category: "Pass",
          categoryName: "通过",
        },
        {
          id: "804da610-7954-11ee-b9d3-005056c00001",
          name: "通过",
          taskDefinitionKey: "secondaryApproval",
          assignee: "admin",
          comment: "审批意见",
          startTime: "2023-11-02 15:50:33",
          endTime: "2023-11-02 15:50:34",
          deleteReason: null,
          category: "Pass",
          categoryName: "通过",
        },
        {
          id: "804da610-7954-11ee-b9d3-005056c00001",
          name: "审批中",
          taskDefinitionKey: "secondaryApproval",
          assignee: "admin",
          comment: "审批意见",
          startTime: "2023-11-02 15:50:33",
          endTime: "2023-11-02 15:50:34",
          deleteReason: null,
          category: "Pass",
          categoryName: "通过",
        },
      ],
      //文件上传
      uploadUrl: "",
    };
  },

  mounted() {
    // this.getProjectListApi();
    for (let i = 0; i < 5; i++) {
      this.renderData.push({
        bh: "RK20230619-000" + i,
        fqsj: "2023-06-19 12:00:12",
        djzt: "通过",
        cllx: "钢筋",
        pplx: "中国制造",
        clbm: "RK20230619-000" + i,
        clmc: "钢筋",
        gysmc: "13号线供应商",
        gg: "1",
        dw: "吨",
        hgzt: "合格",
        fzr: "张三",
        csr: "李四",
        xgwj: "",
      });
    }
    for (let i = 0; i < 3; i++) {
      this.renderDataThree.push({
        cllx: "钢筋",
        ppmc: "CLKR-00" + i,
        clmc: "0" + i,
        clbm: "0" + i,
        ggxh: "1",
        dw: "吨",
        dj: "1000",
        md: "50",
        shl: "9",
        hs: "否",
        bhz: "否",
        bz: "",
        rksl: i * 100 + 200,
      });
    }
  },

  methods: {
    //合计
    getSummaries(param) {
      const { columns, data } = param;
      console.log(columns);
      const sums = [];
      columns.forEach((column, index) => {
        if (index === 0) {
          sums[index] = "合计";
          return;
        }
        const values = data.map((item) => {
          console.log(column.property);
          if (column.property == "rksl") {
            return Number(item[column.property]);
          }
        });

        if (!values.every((value) => isNaN(value))) {
          sums[index] = values.reduce((prev, curr) => {
            const value = Number(curr);

            if (!isNaN(value)) {
              return prev + curr;
            } else {
              return prev;
            }
          }, 0);
          sums[index] += "";
        } else {
          sums[index] = "";
        }
      });

      return sums;
    },
    // 搜索
    searchHandler() {
      this.isSearch = true;
      if (this.projectInput === "") {
        this.$message({
          message: "请输入查询条件",
          type: "warning",
        });
      } else {
        // this.getProjectListApi(1, this.pageSize, this.projectInput);
      }
    },
    // 重置
    resetHandler() {
      this.getProjectListApi();
      this.projectInput = "";
      this.isSearch = false;
    },
    shuaxin() {
      // this.getProjectListApi();
      // this.projectInput = "";
      // this.isSearch = false;
    },
    // 新增
    addHandler() {
      this.editTiele = "新增";
      this.editDialogStatus = true;
      this.editProjectIdentifyInput = "";
      this.editProjectInput = "";
    },
    // 审核
    audit() {
      console.log(this.multipleSelection);
      if (this.multipleSelection.length > 1) {
        this.$message({
          message: "审核不能选择多条",
          type: "warning",
        });
        this.multipleSelection = [];
      } else if (this.multipleSelection.length == 0) {
        this.$message({
          message: "未选择审核数据",
          type: "warning",
        });
      } else {
        this.$confirm(`"确认对"${this.multipleSelection[0].bh}"发起审批吗"`, "提示", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning",
        })
          .then(() => {
            this.auditDialogStatus = true;
          })
          .catch(() => {
            this.$message({
              type: "info",
              message: "已取消审批",
            });
          });
      }
    },
    //   编辑
    editHandler(v) {
      this.editTiele = "编辑";
      this.editDialogStatus = true;
      this.from = v;
    },

    // 删除
    deleteHandler(v) {
      console.log("delete::: ", v);
      this.$confirm("此操作将永久删除该信息?", "提示", {
        confirmButtonText: "确定删除",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          //   this.deleteProjectApi([v.id]);
          this.renderData = this.renderData.filter((ele) => {
            var flag = false;
            // 如果不一致，则保留该行
            for (const key in v) {
              if (ele[key] != v[key]) {
                flag = true;
                break;
              }
            }
            return flag;
          });
          this.$message.success("删除成功");
        })
        .catch(() => {
          this.$message({
            type: "info",
            message: "已取消删除",
          });
        });
    },
    // 每页几条
    handleSizeChange(v) {
      this.pageSize = v;
      this.currentPage = 1;
      if (this.isSearch === true) {
        // this.getProjectListApi(1, v, this.projectInput);
      } else {
        // this.getProjectListApi(1, v);
      }
    },
    // 分页
    handleCurrentChange(v) {
      this.currentPage = v;
      if (this.isSearch === true) {
        // this.getProjectListApi(v, this.pageSize, this.projectInput);
      } else {
        // this.getProjectListApi(v, this.pageSize);
      }
    },
    // editDialog保存
    editSaveHandler() {
      this.editDialogStatus = false;
      let params = {
        mark: this.editProjectIdentifyInput,
        name: this.editProjectInput,
      };

      if (this.editTiele == "新增") {
        this.addProjectApi(params);
      } else {
        this.updateProjectApi(params);
      }
    },

    /**接口 */
    // 查询项目列表
    getProjectListApi(pageNum = 1, pageSize = 10, name = "") {
      let params = {
        pageNum,
        pageSize,
        name,
      };

      console.log(params);

      //   getProjectList(params).then((res) => {
      //     if (res.code == 200) {
      //       this.renderData = res.data.records;
      //       this.total = res.data.total;
      //       this.pageSize = res.data.size;
      //     }
      //   });
    },
    // 项目详情
    projectDetailApi(params) {
      console.log(params);
      //   projectDetail(params).then((res) => {
      //     console.log("res::: ", res);
      //   });
    },
    // 新增项目
    addProjectApi(params) {
      console.log(params);
      this.$confirm("确认新增本条信息?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          //   this.deleteProjectApi([v.id]);
          // this.renderData.push({
          //   bdmc: "成都13号线1工区",
          //   dh: "RK20230619-00",
          //   djry: "登陆者",
          //   djrq: "2023-06-19 12:00:12",
          //   rkrq: "2023-06-19 12:00:12",
          //   rklx: "采购",
          //   lcmc: "成都13号线物资总仓",
          //   gysmc: "13号线供应商",
          //   cllx: "钢筋",
          //   clbm: "",
          //   clmc: "钢筋",
          //   gg: "1",
          //   dw: "吨",
          //   rksl: 500,
          //   bz: " ",
          // });
          this.$message.success("审核成功");
          this.editDialogStatus = false;
        })
        .catch(() => {
          this.$message({
            type: "info",
            message: "已取消删除",
          });
        });

      //   addProject(params).then((res) => {
      //     if (res.code == 200) {
      //       let pgn =
      //         Number.isInteger(this.total / this.pageSize) == true
      //           ? this.total / this.pageSize + 1
      //           : Math.ceil(this.total / this.pageSize);
      //       this.getProjectListApi(pgn, this.pageSize);
      //     } else {
      //       this.$message.error("新增失败");
      //     }
      //   });
    },
    // 新增项目
    shenheProjectApi(params) {
      console.log(params);
      this.$confirm("确认审核本条信息?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          //   this.deleteProjectApi([v.id]);
          // this.renderData.push({
          //   bdmc: "成都13号线1工区",
          //   dh: "RK20230619-00",
          //   djry: "登陆者",
          //   djrq: "2023-06-19 12:00:12",
          //   rkrq: "2023-06-19 12:00:12",
          //   rklx: "采购",
          //   lcmc: "成都13号线物资总仓",
          //   gysmc: "13号线供应商",
          //   cllx: "钢筋",
          //   clbm: "",
          //   clmc: "钢筋",
          //   gg: "1",
          //   dw: "吨",
          //   rksl: 500,
          //   bz: " ",
          // });
          this.$message.success("审核成功");
          this.auditDialogStatus = false;
        })
        .catch(() => {
          this.$message({
            type: "info",
            message: "已取消删除",
          });
        });

      //   addProject(params).then((res) => {
      //     if (res.code == 200) {
      //       let pgn =
      //         Number.isInteger(this.total / this.pageSize) == true
      //           ? this.total / this.pageSize + 1
      //           : Math.ceil(this.total / this.pageSize);
      //       this.getProjectListApi(pgn, this.pageSize);
      //     } else {
      //       this.$message.error("新增失败");
      //     }
      //   });
    },
    // 编辑项目
    updateProjectApi(params) {
      console.log(params);
      //   updateProject(params).then((res) => {
      //     if (res.code == 200) {
      //       this.getProjectListApi(this.currentPage, this.pageSize);
      //       this.$message.success("编辑成功");
      //     } else {
      //       this.$message.error(res.message);
      //     }
      //   });
    },
    // 删除项目
    deleteProjectApi(idList = "") {
      let params = { idList };
      console.log(params);
      //   deleteProject(params).then((res) => {
      //     let pgn =
      //       Number.isInteger(this.total / this.pageSize) == true
      //         ? this.total / this.pageSize + 1
      //         : Math.ceil(this.total / this.pageSize);
      //     if (res.code == 200 && this.search === true) {
      //       this.getProjectListApi(pgn, this.pageSize, this.projectInput);
      //       this.$message.success("删除成功");
      //     } else if (res.code == 200 && this.search === false) {
      //       this.getProjectListApi(pgn, this.pageSize);
      //       this.$message.success("删除成功");
      //     } else {
      //       this.$message.error(res.message);
      //     }
      //   });
    },
    //多选
    handleSelectionChange(val) {
      this.multipleSelection = val;
    },
    //文件上传部分
    handlePreview(file) {
      console.log(file);
    },
    handleRemove(file, fileList) {
      console.log(file, fileList);
    },
    beforeRemove(file, fileList) {
      console.log(":fileList:: ", fileList);
      return this.$confirm(`确定移除 ${file.name}？`);
    },
    handleChange(file, fileList) {
      console.log(file, fileList);
      this.files = new FormData();
      fileList.forEach((item) => {
        this.files.append("file", item.raw);
      });
      // this.file.append("file", file.raw);
      this.files.append("biId", this.biId);
      this.files.append("type", "it/plan/month");
      // this.fileUrl = URL.createObjectURL(file.raw[0]);
    },
  },
};
</script>

<style lang="less" scoped>
#warehouseReceipt {
  width: 95%;
  margin: 0 auto;
  margin-top: 1rem;
  .el-date-editor {
    margin: 0;
  }
  .upload-demo {
    width: 100%;
    margin: 0 auto;
    height: 250px;
  }
}
.el-date-editor {
  margin: 0 10px;
}
.overviewContentLeftbottom {
  position: relative;
  padding: 10px;
  border: 1px dashed #909399;
  height: 24rem;
  width: 80%;
  .shenpiPng {
    position: absolute;
    top: -30px;
    right: -60px;
    width: 100px;
    height: 100px;
  }
  .overviewContentLeftbottomTitle {
  }
  .steps {
    .stepsItem {
      display: flex;
      position: relative;
      padding: 2rem;
      //进度条
      .progress {
        position: absolute;
        height: 3rem;
        width: 2px;
        background-color: #eeeeee;
        bottom: -1rem;
        left: 3rem;
      }
      .xmtime {
        display: flex;
        justify-content: space-between;
        width: 100%;
      }
      .nr {
        margin-top: 2px;
      }
    }
    .userImg {
      margin-right: 2rem;
      img {
        width: 2rem;
        height: 2rem;
      }
    }
  }
}
.imgBox {
  position: relative;
  top: 0;
  left: 0;
  .uploadImg {
    position: absolute;
    top: 30%;
    left: 30%;
    visibility: hidden;
  }
}
.imgBox:hover .uploadImg {
  visibility: visible;
}
:deep(.el-dialog__header) {
  background-color: rgb(43, 43, 53);
}
:deep(.el-dialog__title) {
  color: #fff;
}
// 图片上传
.avatar-uploader .el-upload {
  border: 1px dashed #d9d9d9;
  border-radius: 6px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.avatar-uploader .el-upload:hover {
  border-color: #409eff;
}
.avatar-uploader-icon {
  font-size: 28px;
  color: #8c939d;
  width: 178px;
  height: 178px;
  line-height: 178px;
  text-align: center;
}
.avatar {
  width: 178px;
  height: 178px;
  display: block;
}
.pDiv {
  background-color: #f5f7fa;
  color: #909399;
  border: 1px solid #dcdfe6;
  border-right: 0px;
  border-radius: 4px 0 0 4px;
  text-align: center;
  height: 40px;
  line-height: 40px;
  width: 13.7%;
}
:deep(.pSelect) {
  .el-input__inner {
    border-radius: 0 4px 4px 0;
    width: 107.5%;
  }
  .el-input__suffix {
    right: -5%;
  }
}
.mgb-10 {
  margin-bottom: 10px;
}
.upload-problemRectifyList {
  height: 300px;
  overflow: auto;
}
</style>
